From 86b84e6775824ea006202381489b331f6f991edd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20H=C3=A4rdeman?= Date: Sun, 27 Jul 2025 03:50:50 +0200 Subject: [PATCH] bind: update conffiles list MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The previous patches removed a number of conffiles that weren't necessary, meaning we can now assume that any changes or additional files in /etc/bind are things that the user wants to keep. Since /var/lib/bind is the standard location for longer-lived zone data (i.e. not zones that secondary servers have obtained via XFER), we symlink it to /etc/bind/zones so that it survives a sysupgrade. Temporary files (such as XFER:ed zones for secondaries) stay in /var/cache/bind. Signed-off-by: David Härdeman --- net/bind/Makefile | 3 +-- net/bind/files/bind/named.conf | 2 ++ net/bind/files/named.init | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/net/bind/Makefile b/net/bind/Makefile index f9d73b7024..8db0e335a8 100644 --- a/net/bind/Makefile +++ b/net/bind/Makefile @@ -229,8 +229,7 @@ define Package/bind-server/install endef define Package/bind-server/conffiles -/etc/bind/db.root -/etc/bind/named.conf +/etc/bind endef define Package/bind-server-filter-aaaa/install diff --git a/net/bind/files/bind/named.conf b/net/bind/files/bind/named.conf index 93798ea83b..dd44932c96 100644 --- a/net/bind/files/bind/named.conf +++ b/net/bind/files/bind/named.conf @@ -1,6 +1,8 @@ // This is the primary configuration file for the BIND DNS server named. options { + // Default directory for ephemeral zones, long-lived zones + // can be stored under /var/lib/bind (aka /etc/bind/zones) directory "/var/cache/bind"; }; diff --git a/net/bind/files/named.init b/net/bind/files/named.init index aa57e09e2d..7f09bf6b51 100644 --- a/net/bind/files/named.init +++ b/net/bind/files/named.init @@ -11,8 +11,8 @@ config_dir=/etc/bind run_dir=/var/run/named log_dir=/var/log/named cache_dir=/var/cache/bind +zone_dir=$config_dir/zones lib_dir=/var/lib/bind -dyn_dir=/tmp/bind config_file=$config_dir/named.conf config_local_file=$dyn_dir/named.conf.local @@ -25,7 +25,7 @@ start_service() { user_exists bind 57 || user_add bind 57 group_exists bind 57 || group_add bind 57 - for dir in $run_dir $log_dir $cache_dir $lib_dir $dyn_dir; do + for dir in $run_dir $log_dir $cache_dir $zone_dir; do if [ ! -e "$dir" ]; then mkdir -p "$dir" fi @@ -33,6 +33,11 @@ start_service() { chmod 0775 "$dir" done + if [ ! -e $lib_dir ]; then + mkdir -p $(dirname $lib_dir) + ln -sf $zone_dir $lib_dir + fi + if [ ! -s /etc/bind/rndc.key ] && [ ! -s /etc/bind/rndc.conf ]; then rndc-confgen -a chown bind:bind /etc/bind/rndc.key -- 2.30.2